
#pragma once

using namespace System::Collections::Generic;

#include "IUtility.h"

namespace ttg_internal
{
	namespace utils
	{
		///<summary>
		/// Base class for utilities.
		///<summary>
		public ref class Utility abstract : public IUtility
		{
			private:
				System::String ^_name;
				System::String ^_externalName;
				System::String ^_description;
			public:
				///<summary>
				/// Creates utility with given name and description (that will be viewable for user).
				///</summary>
				Utility(System::String ^externalName, System::String ^description)
				{
					_name = "Not set";
					_externalName = externalName;
					_description = description;
				}
				///<summary>
				/// IUtility member. Returns name, which will be used for utility comparision.
				///</summary>
				property System::String ^Name
				{
					virtual System::String ^get()
					{ return _name; }
					virtual void set(System::String ^value)
					{ _name = value; }
				}
				///<summary>
				/// IUtility member. Returns name, which will visible for user.
				///</summary>
				property System::String ^ExternalName
				{
					virtual System::String ^get()
					{ return _externalName; }
				}
				///<summary>
				/// IUtility member. Returns description of the utility (for user).
				///</summary>
				property System::String ^Description
				{
					virtual System::String ^get()
					{ return _description; }
				}
				///<summary>
				/// IUtility member. Utility should be inited in this method.
				/// For example, GUI-utility should create a new thread.
				///<summary>
				virtual void Init(UtilityProps ^props, UtilController ^controller, GlobalInfo ^info) abstract;
				///<summary>
				/// This method will be called after each pipeline launch.
				/// Step defines approximate time of launch.
				///<summary>
				virtual void Update(float step) abstract;
				///<summary>
				/// Utility should be closed in this method.
				///</summary>
				virtual void Close() abstract;
				///<summary>
				/// Should return true, if utility is active and visible for user. False otherwise.
				///</summary>
				virtual bool IsActive() abstract;
				///<summary>
				/// Should change status from active to unactive (or vice versa).
				/// For example: this method can minimize/maximize window.
				///<summary>
				virtual void ActivateOrDeActivate() abstract;
		};
	}
}
